const app = getApp();
Page({
  data: {
    nowCity: "",
    elements: [{
        title: '报名课程',
        name: 'course',
        color: 'cyan',
        url:"/pages/user/my-course/my-course",
        icon: 'newsfill'
      },
      {
        title: '关注教学点',
        name: 'Point',
        color: 'blue',
        url: "/pages/user/my-school/my-school",
        icon: 'colorlens'
      },
      {
        title: '近期活动',
        name: 'Activity',
        color: 'olive',
        url: "/pages/home/activity/activity",
        icon: 'album'
      }
    ],
    searchVal:""
  },
  changCity() {
    wx.navigateTo({
      url: '/pages/component/city/city'
    })
  },
  bindblur: function (e) {
    // this.setData({
    //   searchVal: e.detail.value
    // })
    wx.navigateTo({
      url: '/pages/home/searchCourse/searchCourse?search=' + e.detail.value
    })
  },
  clickSearch(e){
    let searchVal = this.data.searchVal;
    wx.navigateTo({
      url: '/pages/home/searchCourse/searchCourse?search=' + searchVal
    })
  },
  onShow() {
    if (app.globalData.selectedCity.name != undefined) {
      this.setData({
        nowCity: app.globalData.selectedCity.name
      })
    } else {
      this.setData({
        nowCity: "西安"
      })
    }
    // console.log(app.globalData.selectedCity.name)
  },
})